//
//  SISSHouseNumVerifyErrorViewController.m
//  SISSAPP
//
//  Created by 袁应荣 on 2019/6/27.
//  Copyright © 2019 优房网. All rights reserved.
//

#import "SISSHouseNumVerifyErrorViewController.h"

@interface SISSHouseNumVerifyErrorViewController ()

///
@property (weak, nonatomic) UIImageView *errImageView;
///
@property (weak, nonatomic) UILabel *titleLabel;
///
@property (weak, nonatomic) UILabel *resonLabel;

@end

@implementation SISSHouseNumVerifyErrorViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)setErrorMsg:(NSString *)errorMsg {
    _errorMsg = errorMsg;
    self.resonLabel.text = errorMsg;
}

- (void)setupSubviews {
    [super setupSubviews];
    
    UIImageView *errImageView = [[UIImageView alloc] init];
    errImageView.image = [UIImage imageNamed:@"出错"];
    [self.view addSubview:errImageView];
    self.errImageView = errImageView;
    
    UILabel *titleLabel = [UILabel yyr_labelWithText:@"房源编码核验失败" fontSize:16 textColor:MAIN_TEXT_COLOR];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:titleLabel];
    self.titleLabel = titleLabel;
    
    UILabel *resonLabel = [UILabel yyr_labelWithText:@"" fontSize:15 textColor:SECONDARY_TEXT_COLOR];
    resonLabel.text = self.errorMsg;
    resonLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:resonLabel];
    self.resonLabel = resonLabel;
    
}


- (void)initConstraint {
    [super initConstraint];
    
    WeakSelf
    CGSize imageSize = CGSizeMake(88, 88);
    [self.errImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.mas_topLayoutGuideBottom).offset(4 * globelMargin);
        make.centerX.equalTo(weakSelf.view);
        make.size.mas_equalTo(imageSize);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.errImageView.mas_bottom).offset(2 * globelMargin);
        make.centerX.equalTo(weakSelf.view);
    }];
    
    [self.resonLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.titleLabel.mas_bottom).offset(3 * globelMargin);
        make.left.equalTo(weakSelf.view).offset(2 * globelMargin);
        make.right.equalTo(weakSelf.view).offset(-2 * globelMargin);
    }];
}


@end
